import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Students from '../views/Students.vue'
import Dorms from '../views/Dorms.vue'
import Dormadmin from '../views/Dormadmin.vue'
import Dormchange from '../views/Dormchange.vue'
import Maintenance from '../views/Maintenance.vue'
import HomeCharts from '../views/HomeCharts.vue'


Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    children: [
      {
        path: 'students',
        name: 'students',
        component: Students
      },
      {
        path: 'dorms',
        name: 'dorms',
        component: Dorms
      },
      {
        path: 'dormadmin',
        name: 'dormadmin',
        component: Dormadmin
      },
      {
        path: 'dormchange',
        name: 'dormchange',
        component: Dormchange
      },
      {
        path: 'maintenance',
        name: 'maintenance',
        component: Maintenance
      },
      {
        path: 'homecharts',
        name: 'homecharts',
        component: HomeCharts
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
